package com.linwen.excise.leetcode;

/**
 * @ClassName _2312的幂
 * @Description TODO
 * @Author zero
 * @DATE 2024/9/22 2:22 AM
 * @Version 1.0
 */
public class _2312的幂 {
    public static void main(String[] args) {
        _2312的幂 inst = new _2312的幂();
        System.out.println(inst.isPowerOfTwo(16));
    }
    public boolean isPowerOfTwo(int n) {
        return n > 0 && (n & (n - 1)) == 0;

    }
}
